package number

import (
	"log"
	"math/big"
	"strings"
)

// Str2Num used to parse a string to a big.Int number
func Str2Num(in string) *big.Int {
	str := strings.TrimSpace(in)
	out, success := new(big.Int).SetString(str, 0)
	if !success {
		log.Panicf("input %s is not a valid number", str)
	}
	return out
}
